$(document).ready(function () {
    $(".closeAdvert").click(function () {
        var topAdvertImg = document.getElementById("top_advert_img");
        topAdvertImg.style.display = "none";
        return false;
    });
    $(".closeQrCode").click(function () {
        var qrCode = document.getElementById("Qr_code");
        qrCode.style.display = "none";
        return false;
    });
    $(".changeCity").click(function () {
        var areaList = document.getElementById("areaList");
        areaList.style.display = "block";
    });
    $($("#areaList").children().children()).each(function () {
        $(this).click(function () {
            var city = $(".city");
            city.attr("value", "");
            city.attr("value", $(this).text())
        })
    });
    $(document).mouseup(function (e) {
        var child = $("#areaList");// 设置目标区域
        if (!child.is(e.target) && child.has(e.target).length === 0) {
            areaList.style.display = "none";
        }
    });

    // 以下为悬浮块
    // var ie6 = document.all;
    // var dv = $('#rollingBox'), st;
    // dv.attr('otop', dv.offset().top); //存储原top距离
    // $(window).scroll(function () {
    //     var rollingBox = document.getElementById("#rollingBox");
    //     st = Math.max(document.body.scrollTop || document.documentElement.scrollTop);
    //     if (st > parseInt(dv.attr('otop'))) {
    //         if (ie6) {//IE6不支持fixed属性，所以只能靠设置position为absolute和top实现此效果
    //             dv.css({position: 'absolute', top: st,right:0});
    //         }
    //         else if (dv.css('position') !== 'fixed')
    //             dv.css({'position': 'fixed', top: 0,right:0});
    //     } else if (dv.css('position') !== 'static') dv.css({'position': 'static'});
    // });

})